package com.github.ginirohikocha.dbm.entity;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

public class Order implements Serializable {

    public Order() { }

    public Order(Integer id, String orderNum, Integer branchId, Integer faultId, String faultDescription, String contactName, String contactAddress, String contactLongitude, String contactLatitude, String contactPhone, String progress, BigDecimal estimatedPrice, String status, String onlinevideo, Integer customerId, Integer workerid, Date ordertime, String type) {
        this.id = id;
        this.orderNum = orderNum;
        this.branchId = branchId;
        this.faultId = faultId;
        this.faultDescription = faultDescription;
        this.contactName = contactName;
        this.contactAddress = contactAddress;
        this.contactLongitude = contactLongitude;
        this.contactLatitude = contactLatitude;
        this.contactPhone = contactPhone;
        this.progress = progress;
        this.estimatedPrice = estimatedPrice;
        this.status = status;
        this.onlinevideo = onlinevideo;
        this.customerId = customerId;
        this.workerid = workerid;
        this.ordertime = ordertime;
        this.type = type;
    }

    private Integer id;
    private String orderNum;
    private Integer branchId;
    private Integer faultId;
    private String faultDescription;
    private String contactName;
    private String contactAddress;
    private String contactLongitude;
    private String contactLatitude;
    private String contactPhone;
    /**
     * 进度
     */
    private String progress;
    /**
     * 预估价格
     */
    private BigDecimal estimatedPrice;
    /**
     * 状态：
     */
    private String status;
    /**
     * 视频
     */
    private String onlinevideo;
    /**
     * 用户id  电话订单给个特殊id
     */
    private Integer customerId;
    private Integer workerid;
    private Date ordertime;

    //订单类型，电话or普通
    private String type;

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getOrderNum() {
        return orderNum;
    }

    public void setOrderNum(String orderNum) {
        this.orderNum = orderNum;
    }

    public Integer getBranchId() {
        return branchId;
    }

    public void setBranchId(Integer branchId) {
        this.branchId = branchId;
    }

    public Integer getFaultId() {
        return faultId;
    }

    public void setFaultId(Integer faultId) {
        this.faultId = faultId;
    }

    public String getFaultDescription() {
        return faultDescription;
    }

    public void setFaultDescription(String faultDescription) {
        this.faultDescription = faultDescription;
    }

    public String getContactName() {
        return contactName;
    }

    public void setContactName(String contactName) {
        this.contactName = contactName;
    }

    public String getContactAddress() {
        return contactAddress;
    }

    public void setContactAddress(String contactAddress) {
        this.contactAddress = contactAddress;
    }

    public String getContactLongitude() {
        return contactLongitude;
    }

    public void setContactLongitude(String contactLongitude) {
        this.contactLongitude = contactLongitude;
    }

    public String getContactLatitude() {
        return contactLatitude;
    }

    public void setContactLatitude(String contactLatitude) {
        this.contactLatitude = contactLatitude;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getProgress() {
        return progress;
    }

    public void setProgress(String progress) {
        this.progress = progress;
    }

    public BigDecimal getEstimatedPrice() {
        return estimatedPrice;
    }

    public void setEstimatedPrice(BigDecimal estimatedPrice) {
        this.estimatedPrice = estimatedPrice;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getOnlinevideo() {
        return onlinevideo;
    }

    public void setOnlinevideo(String onlinevideo) {
        this.onlinevideo = onlinevideo;
    }

    public Integer getCustomerId() {
        return customerId;
    }

    public void setCustomerId(Integer customerId) {
        this.customerId = customerId;
    }

    public Integer getWorkerid() {
        return workerid;
    }

    public void setWorkerid(Integer workerid) {
        this.workerid = workerid;
    }

    public Date getOrdertime() {
        return ordertime;
    }

    public void setOrdertime(Date ordertime) {
        this.ordertime = ordertime;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    @Override
    public String toString() {
        return "Orders{" +
                "id=" + id +
                ", branchId=" + branchId +
                ", faultId=" + faultId +
                ", orderNum=" + orderNum +
                ", faultDescription=" + faultDescription +
                ", contactName=" + contactName +
                ", contactAddress=" + contactAddress +
                ", contactLongitude=" + contactLongitude +
                ", contactLatitude=" + contactLatitude +
                ", contactPhone=" + contactPhone +
                ", progress=" + progress +
                ", estimatedPrice=" + estimatedPrice +
                ", status=" + status +
                ", onlinevideo=" + onlinevideo +
                ", customerId=" + customerId +
                ", workerid=" + workerid +
                ", ordertime=" + ordertime +
                ", type=" + type +
                "}";
    }

    /**
     * 转换成代办状态
     * **/
    public String transferStatus() {
        String status = getStatus();
        if (status.equals("已接单"))
            return "待商定业务价格";
        if (status.equals("已确认"))
            return "开始维修";
        if (status.equals("已完成"))
            return "待客户付款";
        if (status.equals("已付款"))
            return "待客户评价";
        if (status.equals("已评价"))
            return "订单已完成";
        return status;
    }
}
